<?php
define('NO_CHECK_LOGIN','false');
require 'init.php';
if(isset($_SESSION['cms']['admin'])){
		$user=$_SESSION['cms']['admin'];
	}
if ( @$user[ 'username' ] != '' ) {
    $userid=$user['userid'];
    $login="退出登录";
	$herf="../model/userdata.php";
	if(file_exists("../../upload/userphoto/userphoto_$userid.jpg")){
          $photo = "../../upload/userphoto/userphoto_$userid.jpg";  
        }else{
          $photo = "../../upload/userphoto/userphoto_0.jpg";
        }
    }else{
    $login="去登录";
	$herf="../model/login.php";                
	$photo = "../../upload/userphoto/userphoto_0.jpg";
    }
    $result=mysqli_query($link,"SELECT * FROM `dy1table` ORDER BY `dy1id` DESC") ;
    $dy1data = mysqli_fetch_all($result,MYSQLI_ASSOC);
    $i=0;
    
    $hostdir1='../../upload/dynamic2/life'; //要读取的文件夹
    $filesnames1 = scandir($hostdir1); //得到所有图片
    $ii=0;
    
    $web1data=mysqli_query($link,"SELECT * FROM `webtable` WHERE `websrc`='web1' ORDER BY `webid` DESC");
    $web2data=mysqli_query($link,"SELECT * FROM `webtable` WHERE `websrc`='web2' ORDER BY `webid` DESC");
    $web1data=mysqli_fetch_all($web1data,MYSQLI_ASSOC);
    $web2data=mysqli_fetch_all($web2data,MYSQLI_ASSOC);
    $iii=0;
    
require '../view/index.html';
?>